From 3994fe88799767587fc443f383fa323a6ec46065 Mon Sep 17 00:00:00 2001
From: =?utf8?q?=C3=98yvind=20Kol=C3=A5s?=
Date: Mon, 12 Jun 2006 19:33:06 +0000
Subject: [PATCH] do not do type checking based on pointer decorations in a
public API
---
ChangeLog | 11 +++++++++++
babl/babl-fish-reference.c | 11 ++++++-----
babl/babl-fish.c | 4 ++++
babl/babl-memory.c | 1 +
docs/index-static.html.in | 22 ++++++++++++----------
5 files changed, 34 insertions(+), 15 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 118cdc8..da7b6f2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2006-06-12 Ãyvind KolÃ¥s
+
+ Do not expect the user to pass in BablImages (existance of babl
+ pointer decorations should not be allowed to be used to implement type
+ checking for provided buffers/bablimages)
+
+ * babl/babl-fish.c: (babl_fish_process):
+ * babl/babl-fish-reference.c: (babl_fish_reference_process):
+ * docs/index-static.html.in: removed section about planar BablImages
+ since the API is now disabled.
+
2006-06-06 Ãyvind KolÃ¥s
Register all the formats that the gggl based conversions use in
diff --git a/babl/babl-fish-reference.c b/babl/babl-fish-reference.c
index 88119a2..8acaab1 100644
--- a/babl/babl-fish-reference.c
+++ b/babl/babl-fish-reference.c
@@ -246,13 +246,14 @@ babl_fish_reference_process (Babl *babl,
if (BABL(babl->fish.source)->format.model ==
BABL(babl->fish.destination)->format.model)
return process_same_model (babl, source, destination, n);
-
+#if 0
if (BABL_IS_BABL (source) ||
BABL_IS_BABL (destination))
{
babl_log ("args=(%p, %p, %p, %li): trying to handle BablImage (unconfirmed code)",
babl_fish, source, destination, n);
}
+#endif
source_double_buf = babl_malloc(sizeof (double) * n *
BABL(babl->fish.source)->format.model->components);
@@ -269,8 +270,8 @@ babl_fish_reference_process (Babl *babl,
convert_to_double (
(BablFormat*) BABL(babl->fish.source),
- BABL_IS_BABL(source)?source:NULL,
- BABL_IS_BABL(source)?NULL:source,
+ NULL,
+ source,
source_double_buf,
n
);
@@ -323,8 +324,8 @@ babl_fish_reference_process (Babl *babl,
convert_from_double (
(BablFormat*) BABL(babl->fish.destination),
destination_double_buf,
- BABL_IS_BABL(destination)?destination:NULL,
- BABL_IS_BABL(destination)?NULL:destination,
+ NULL,
+ destination,
n
);
diff --git a/babl/babl-fish.c b/babl/babl-fish.c
index 50737f3..8ced857 100644
--- a/babl/babl-fish.c
+++ b/babl/babl-fish.c
@@ -144,13 +144,17 @@ babl_fish_process (Babl *babl,
case BABL_FISH_SIMPLE:
case BABL_FISH_PATH:
+#if 0
if (BABL_IS_BABL (source))
source_image = source;
+#endif
if (!source_image)
source_image = (BablImage*) babl_image_from_linear (
source, (Babl*)babl->fish.source);
+#if 0
if (BABL_IS_BABL (destination))
destination_image = destination;
+#endif
if (!destination_image)
destination_image = (BablImage*) babl_image_from_linear (
destination, (Babl*)babl->fish.destination);
diff --git a/babl/babl-memory.c b/babl/babl-memory.c
index 82719ae..ec09ff2 100644
--- a/babl/babl-memory.c
+++ b/babl/babl-memory.c
@@ -144,6 +144,7 @@ babl_free (void *ptr,
if(!IS_BAI(ptr))
babl_fatal ("memory not allocated by babl allocator");
functions_sanity ();
+ BAI(ptr)->signature=NULL;
free_f (BAI(ptr));
frees++;
}
diff --git a/docs/index-static.html.in b/docs/index-static.html.in
index ff9313c..f5e3cc8 100644
--- a/docs/index-static.html.in
+++ b/docs/index-static.html.in
@@ -245,7 +245,7 @@
babl_component ("G'"),
babl_component ("R'"),
NULL);
-
+
Extending
@@ -273,24 +274,25 @@
Color Management
Babl is not a color management system, since it doesn't deal with
- ICC profiles. One way to deal with this is to register a custom color
- model, that is backed by for instance lcms. (see the
- lcms-lab extension) Then when using the newly registered color
- model to create pixel formats, lcms will be used behind the scenes.
-
-
+ ICC profiles. Babl is designed primarily for internal use when the
+ color space is already known (sRGB, CIE Lab, Luminance or similar).
+
+
+ It is also possible to register new color models that are managed by a
+ color management system like lcms, take a look at the lcms-lab
+ extensions for an example.
+
TODO
- Validate that a created BablFishPath is actually faster than the
BablFishReference it is a replacement for.
- - Compile-time instead of runtime profiling / storae of profiling
+
- Compile-time instead of runtime profiling / storage of profiling
and loss data.. (The speed of conversions
is bound to 'wobble', according to architecture, compiler flags,
concurrently running processes and phase of moon.)
- - Horizontal and vertical subsampling (for
- implementing 4:2:2 4:2:0 4:1:1 etc. chroma subsampling)
+ - Horizontal chroma subsampling (4:2:2 and 4:1:1)
- Thread safety (locking) for mutations of the type system.
- Support for datatypes that are not a multiple of 8bit.
- dithering
--
2.30.2